package project;


import org.apache.catalina.Context;
import org.apache.catalina.Wrapper;
import org.apache.catalina.startup.Tomcat;
import project.servlet.TestServlet;

public class Main {
    public Main() {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(8088);
        tomcat.getConnector();
        Context context = tomcat.addContext("", null);
        Wrapper wp = Tomcat.addServlet(context, "text", new TestServlet());
        wp.setLoadOnStartup(1);
        wp.addMapping("/login");
        try {
            tomcat.start();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public static void main(String[] args) {
        new Main();
    }
}
